﻿using System;

namespace SopCastRecorder
{
	public abstract class SopCastBase
	{
		public SopCast SopCast1 { get; set; }
		protected IntPtr MainHandle;
		protected IntPtr[] EditHandles;
		protected IntPtr[] ButtonHandles;

		protected void RefreshHandle()
		{
			Win32Api.GetControls(MainHandle, (edits, buttons) =>
			{
				this.EditHandles = edits;
				this.ButtonHandles = buttons;
			});
		}

		protected virtual bool CheckVisible()
		{
			if (Win32Api.IsWindowVisible(this.MainHandle) == 0)
			{
				return false;
			}
			return true;
		}
		protected virtual bool CheckCaption()
		{
			return true;
		}
		protected abstract bool CheckHandle();

		public Win32Api.RECT GetRect()
		{
			return Win32Api.GetWindowRectCS(this.MainHandle);
		}
	}
}
